﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SiteAgle.ViewHelper;

namespace SiteAgle.Controllers
{
    public class GeneralController : Controller
    {
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            if ((filterContext.ActionDescriptor.ActionName != "Login" && filterContext.ActionDescriptor.ActionName != "Error")
                && UserHelper.IsLoggedIn == false)
            {
                RedirectToRouteResult redirect = RedirectToAction("Login", "Usuario");
                filterContext.Result = redirect;
            }
        }
    }
}